<template>
	<view>
		<view class="jiesuan-box">
			<!-- 全选 -->
			<view class="quanxuan">
				<label class="radio">
					<radio value="" color="red" :checked="isfullcheckout" @click="checkoutall"/><text>全选</text>
				</label>
			</view>
			<view class="heji">
				合计：<text class="amount">￥{{amount}}</text>
			</view>
			<view class="jiesuanbtn">
				<view class="">
					结算（{{jiesuantotal}}）
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"v-jiesuan",
		data() {
			return {
				// jiesuantotal:0
			};
		},
		computed:{
			jiesuantotal(){
				// this.jiesuantotal=this.$store.getters.jiesuantotal
				 return this.$store.getters.jiesuantotal
			},
			total(){
				return this.$store.getters.shopcartotal
			},
			isfullcheckout(){
				return this.jiesuantotal==this.total
			},
			amount(){
				return this.$store.getters.amount
			}
		},
		watch:{
			// total(newvalue){
			// 	uni.setTabBarBadge({
			// 		index:2,//此处为tabbar页面的索引
			// 		text:newvalue+""
			// 	})
			// }
		},
		methods:{
			//全部选择事件回调
			checkoutall(){
				this.$store.commit("checkoutall")
			}
		}
	}
</script>

<style lang="scss">
.jiesuan-box{
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 50px;
	background-color: white;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	.quanxuan{
		padding-left: 15px;
		.radio{
			
		}
	}
	.heji{
		.amount{
			color: red;
			font-weight: bold;
		}
	}
	.jiesuanbtn{
		background-color: red;
		height: 50px;
		color: white;
		line-height: 50px;
		padding: 0 10px;
		width: 100px;
		text-align: center;
	}
}
</style>